package com.oe.market.modules.ele.model.mapper;

import com.oe.market.modules.base.model.bean.Account;
import com.oe.market.modules.ele.model.bean.RedPackage;
import com.oe.market.modules.ele.model.dto.EleRedPackageDto;
import com.oe.market.modules.ele.validator.EleRedPackage;

public class EleRedPackageMapper {
    protected RedPackage redPackage;

    public RedPackage getRedPackage() {
        redPackage.recipient = redPackage.from;
        return redPackage;
    }

    public EleRedPackageDto getEleRedPackageDto() {
        EleRedPackageDto eleRedPackageDto = new EleRedPackageDto();
        eleRedPackageDto.groupSn = redPackage.groupSn;
        eleRedPackageDto.luckyPos = redPackage.luckyPos;
        eleRedPackageDto.platform = redPackage.platform;

        return eleRedPackageDto;
    }
    public EleRedPackageMapper(RedPackage redPackage) {
        this.redPackage = redPackage;
    }
    public EleRedPackageMapper(EleRedPackageDto eleRedPackageDto, Account account) {
        this.redPackage = new RedPackage();
        redPackage.groupSn = eleRedPackageDto.groupSn;
        redPackage.luckyPos = eleRedPackageDto.luckyPos;
        redPackage.url = eleRedPackageDto.url;
        redPackage.from = account.user;
        redPackage.platform = eleRedPackageDto.platform;
    }


}
